package com.spring.sunflower.common

import com.spring.sunflower.base.BaseObserver
import com.spring.sunflower.base.BasePresenter
import com.spring.sunflower.bean.BillListBean

/**
 * Created by Kevin on 2021/8/28<br/>
 *
 * Describe:<br/>
 */
class ChargeRecordPresenter(baseView: CommonContract.ChargeRecordView) :
    BasePresenter<CommonContract.ChargeRecordView>(baseView) {
    fun getChargeRecord(userId: String, pageIndex: String) {
        val observable = requestDataSource.requestBillList(userId, pageIndex, "1")
        addDisposable(observable, object : BaseObserver<BillListBean>(baseView) {
            override fun onSuccess(bean: BillListBean) {
                baseView.showChargeRecord(bean.datas!!)
            }

            override fun onError(status: Int, msg: String?) {
            }
        })
    }
}